import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
      home: Scaffold(
          appBar: AppBar(title: const Text("hello1")),
          body: const Column(children: [MyApp(), MyButton(), MyText()]))));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        margin: const EdgeInsets.fromLTRB(0, 60, 0, 0),
        alignment: Alignment.center,
        width: 200,
        height: 200,
        // transform: Matrix4.translationValues(50, 0, 0), //位移
        // transform: Matrix4.rotationZ(0.2), //旋转
        transform: Matrix4.skewY(0.2), //倾斜

        decoration: BoxDecoration(
            color: Colors.red,
            border: Border.all(color: Colors.greenAccent, width: 3),
            borderRadius: BorderRadius.circular(10), //配置圆角,可以实现圆形绘制
            boxShadow: const [
              //配置阴影
              BoxShadow(
                  color: Colors.blue,
                  offset: Offset(20.0, 20.0), //阴影偏移
                  blurRadius: 20.0),
            ], //LinearGradient背景线性渐变RadialGradient径向渐变
            gradient: //配置渐变填充色
                const LinearGradient(colors: [Colors.red, Colors.orange])),
        child: const Text(
          "hello flutter",
          style: TextStyle(color: Colors.white, fontSize: 35),
        ),
      ),
    );
  }
}

class MyButton extends StatelessWidget {
  const MyButton({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      width: 200,
      height: 40,
      margin: const EdgeInsets.fromLTRB(0, 50, 0, 0),
      // padding: const EdgeInsets.all(2),
      padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),

      decoration: BoxDecoration(
          color: const Color.fromARGB(255, 233, 64, 255),
          borderRadius: BorderRadius.circular(10)),
      child:
          const Text("按钮", style: TextStyle(color: Colors.amber, fontSize: 30)),
    );
  }
}

class MyText extends StatelessWidget {
  const MyText({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.fromLTRB(0, 30, 0, 0),
      width: 200,
      height: 50,
      decoration: const BoxDecoration(color: Colors.amber),
      child: const Text(
        "hello .i am flutterhello .i am flutterhello .i am flutterhello .i am flutter",
        textAlign: TextAlign.left,
        overflow: TextOverflow.ellipsis,
        maxLines: 1,
        style: TextStyle(
            fontSize: 12,
            fontWeight: FontWeight.w300,
            fontStyle: FontStyle.italic,
            letterSpacing: 5,
            wordSpacing: 5,
            decoration: TextDecoration.lineThrough,
            decorationColor: Colors.blue,
            decorationStyle: TextDecorationStyle.dotted),
      ),
    );
  }
}
